<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>自定义对象</title>
</head>
<body>
    <h1>自定义对象</h1>

    <script>
        // 方法三：文本标记法

        var zs = {
            name:'张三' ,
            sex:'女',
            score:100,
            hobby:['吃','玩','学习'],
            address:{
                shen:'广东省',
                shi:'珠海市',
                zhen:'白蕉镇'
            },
            study:function(sth) {
                console.log(this.name + "学习" + sth);   
            },
            playGame:function() {
                console.log("玩游戏");
            }
        }

        console.log(zs.name);
        console.log(zs.hobby);
        console.log(zs.address.shen);

        zs.study("《Java高级编程》") ;
        
        



    </script>
</body>
</html>